
// IMPORTS
import MASS.*;                  // MASS Library
import java.util.AbstractMap.*; // for simple key-value pairs

public class MassFour extends Place {
    // CONSTANTS - MASS arguments
    private static final String[] MASSARGS = {"dslab", "dslab-302",
        "machinefile.txt", "12345"};            // connection arguments
    private static final int NPROCESSES = 1;    // number of processes to employ
    private static final int NTHREADS = 8;      // number of threads to employ
    private static final int HANDLE = 0;        // unique Places handle number
    
    
    public static final int init_ = 0;           // initialize Places
    public static final int expose_ = 1;
    public int[] aInts;

    public MassFour(Object interval) {
        aInts = new int[9];

    }

    public Object callMethod(int funcId, Object args) {
        switch (funcId) {
            case init_:
                return init(args);
            case expose_:
                return expose(args);

        }
        return null;
    }

    public Object init(Object args) {
//        aInts = new int[9];

        for (int i = 0; i < 9; ++i) {
            aInts[i] = index[0] * 10 + i;
        }
        System.err.println("Mass Four init: Four called: " + index[0]);
        return (Object) null;
    }
    
    public int[] expose(Object args) {
        System.err.println("Mass Four func 1 expose: node: " + index[0]);
        return aInts;
    }
    
}
